<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
 
  <ui:composition template="/pages/templates/commonLayoutCli.xhtml">

	
	<ui:define name="content">

	<h:form>
		
		<center>
		
			<p:growl id="growlCadastroHorario" showDetail="false" sticky="false"
				life="6000" autoUpdate="true" />
				
			<p:messages id="messagesLogin" showDetail="false" autoUpdate="true" closable="true"/>
		
			<p:panel id="panel" style="width:70%;align:center;valign:middle;">
			<h:panelGrid  columns="2" cellpadding ="5" >
				
				<p:outputLabel value="Tipo Consulta:" ></p:outputLabel>
				<p:selectOneRadio id="tipoHorario" value="#{beanCadastroHorario.valorRadio}">
            		<f:selectItem itemLabel="Ordem Chegada" itemValue="1" />
            		<f:selectItem itemLabel="Hora Marcada" itemValue="2" />
            		<p:ajax listener="#{beanCadastroHorario.habilitarOpcoes()}" update="panel"> </p:ajax>
        		</p:selectOneRadio>
        		</h:panelGrid>	
        		
        		<h:panelGrid id="panelOrdemChegada" columns="6" cellpadding ="5" style="width:100%;align:center;valign:middle;">
        		
        		 <p:outputLabel for="dataInicio" value="Data Inicial:" />
       			 <p:calendar id="dataInicio" value="#{beanCadastroHorario.dataInicial}" pattern="dd/MM/yyyy" disabled="#{beanCadastroHorario.desabilitarOrdemChegada}" mindate="#{beanCadastroHorario.getDataAtual()}"/>
       			 <p:outputLabel for="dataFinal" value="Data Final:" />
       			 <p:calendar id="dataFinal" value="#{beanCadastroHorario.dataFinal}" pattern="dd/MM/yyyy"  disabled="#{beanCadastroHorario.desabilitarOrdemChegada}" mindate="#{beanCadastroHorario.getDataAtual()}"/>
       			 
       			 <h:outputLabel for="vagas" value="Nº Vagas: " />
        		<p:spinner id="vagas" value="#{beanCadastroHorario.numeroVagas}" min="1" max="100" disabled="#{beanCadastroHorario.desabilitarOrdemChegada}" />
       			
       			<p:outputLabel for="horaInicial" value="Hora Inicial:" />
        		<p:calendar id="horaInicial" value="#{beanCadastroHorario.horaInicial}" pattern="HH:mm" timeOnly="true" disabled="#{beanCadastroHorario.desabilitarOrdemChegada}"/>
        		
        		<p:outputLabel for="horaFinal" value="Hora Final:" />
        		<p:calendar id="horaFinal" value="#{beanCadastroHorario.horaFinal}" pattern="HH:mm" timeOnly="true" disabled="#{beanCadastroHorario.desabilitarOrdemChegada}"/>
       			
       			</h:panelGrid>	
       			 
       			 <h:panelGrid  columns="2" cellpadding ="5" style="width: 32%;  position: relative; margin-left: -10px">
        		
        		 <p:outputLabel for="data" value="Data/Hora:" />
       			 <p:calendar id="data" value="#{beanCadastroHorario.dataConsulta}" pattern="dd/MM/yyyy HH:mm" disabled="#{beanCadastroHorario.desabilitarHoraMarcada}" mindate="#{beanCadastroHorario.getDataAtual()}" />
       			
       			<p:confirmDialog id="myDialogID" widgetVar="dialogohor" header="Advertência" severity="alert" message="#{beanCadastroHorario.msgErro}" >
				</p:confirmDialog>
			
				</h:panelGrid>	
				
				<h:panelGrid  columns="2" cellpadding ="5" style="width: 32%;  position: relative; margin-left: -60px">
					<p:outputLabel for="profissional" value="Profissional:" />
       			 	<p:selectOneMenu id="profissional" disabled="#{beanCadastroHorario.desabilitarProfissionais}" value="#{beanCadastroHorario.codigoProfissional}" >
       			 	<f:selectItems  value="#{beanCadastroHorario.profissionais}" var="profissional" itemLabel="#{profissional.nome}"  itemValue="#{profissional.codigo}" ></f:selectItems>
       			 
       			 </p:selectOneMenu>
				</h:panelGrid>	
				<p:commandButton value="Adicionar"  action="#{beanCadastroHorario.criaHorario()}" update="panel" disabled="#{beanCadastroHorario.habilitaAdicionar}">
				 
				</p:commandButton>	
			
			</p:panel>
		</center>
	
	</h:form>
</ui:define>

</ui:composition>

</html>